<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 liansitional//EN" "http://www.w3.org/li/xhtml1/DTD/xhtml1-liansitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>top</title>
<script type="text/javascript" src="common/jquery/jquery.min.js"></script>
<link href="common/css/bottom.css" rel="stylesheet" type="text/css" />
<SCRIPT type=text/javascript>
	var msgCount = 0;
	var ignoreState = false;
	$.ready = function()
	{
		var isIE6Up = true;
		if(navigator.appName == "Microsoft Internet Explorer") 
		{
			if(navigator.appVersion.match(/MSIE 6./i)=='MSIE 6.') 
			{
				isIE6Up=false; 
			}
		}
		if("${sessionScope.sessionbean.userName}"=="")
		{
			window.top.location.href="login.jsp?timeOut=true";
		}
//		listNmMessage();
		setInterval("showTime('"+isIE6Up+"')",1000);
//		setInterval("listNmMessage()",500000);
	}
	function listNmMessage(){
		var tmp = parseInt(Math.random()*1000000+1);
		var url = 'listNumMessage.do?tmp='+tmp;
		$.get(url, {},function (data, textStatus){
			if(/^\d+$/.test(data)){
				if(data!="0")
				{
					$("#msgCount").text("("+data+")");
					msgCount = parseInt(data);
				}
				else
				{
					$("#msgCount").text("");
					msgCount = 0;
				}
			}
			else
			{
				window.top.location.href="login.jsp?timeOut=true";
			}
		});
	}
	function listMessage(){
	    var url ="listMessage.do";
	    toUrl(url,"消息管理");
	}
	function showTime(test)
	{
		var d=new Date();
		var week=' 星期'+'日一二三四五六'.charAt(new Date().getDay());
		if(test=="false")
			week="";
		document.getElementById('dateTime').innerHTML=d.toLocaleString()+week;
	}
	function showSysNom()
	{   
		document.getElementById('dateTime').innerHTML=d.toLocaleString()+week;
	}
	function quit()
	{
		if(confirm("确认退出？"))
		{
			window.top.location.href="quit!LogOut.do";
		}
	}
	function toUrl(url,title)
	{
		var frameName = window.top.frameName;
		var tabStyle = window.top.tabStyle;
		//使用tab框架
		if(tabStyle=="tabFrame_yes")
		{
			eval("window.top.mainFrame."+frameName+".location.href = '"+url+"'");
			window.top.mainFrame.frameTabs.setTabTitle(title);
		}
		else
			window.top.mainFrame.location.href = url;
	}
	function showMain()
	{
		var url = "jsp/main/main/listMain.do";
		toUrl(url,"首页");
	}
	
	function updSetting()
	{
		var url = "jsp/system/user/updateSettingUser.do";
		toUrl(url,"个人设置");
	}
	
	
</SCRIPT>
</head>

<body>
<div class="statusBar">
	<ul>
		<li id="currentUser">当前用户：${sessionScope.sessionbean.userName}</li>
		<li id="splitLine">&nbsp;</li>
		<li id="currentDept">${applicationScope.sysConfig.applicationName}<c:if test="${workerName ne null}">(${workerName})</c:if></li>
		<li id="splitLine">&nbsp;</li>
		<li id="usualFeatures">
			<!-- 消息 -->
<!-- 		<a href="#" onclick='listMessage()'><img src="images/bottom/message1.png" width="16" height="16" title="我的消息" /><span style="position:relative;top:-3px; " id="msgCount"></span></a>&nbsp;&nbsp; -->
			<a href="#" onclick='showMain()'><img src="images/bottom/home.png" width="16" height="16" title="首页" /></a>&nbsp;&nbsp;
<!-- 		<a href="jsp/main/desktop/index_desktop.htm" target="mainFrame"><img src="images/bottom/desktop.png" width="16" height="16" title="我的工作台" /></a>&nbsp;&nbsp; -->
			<a href="#" onclick='updSetting()'><img src="images/bottom/user_setting.png" width="16" height="16" title="个人设置" /></a>&nbsp;&nbsp;
			<a href="#" onclick='quit()'><img src="images/bottom/quit.png" width="16" height="16" title="退出" /></a>&nbsp;&nbsp;
		</li>
	</ul>
	<div>
	<ul id="rightBar">
		<li id="splitLine">&nbsp;</li>
		<li id="dateTime"></li>
	</ul>
	</div>
</div>
</body>
</html>
